<? 
	$title="Edit category"; 
	$pageid="5";
	$accessid="a00";
	
	require("required/dbconnect.php"); 
	require("required/function.php");
	require("required/header.php");
	
	checkAccess("allow_user_management",1);
	
	$id=$_GET['id'];
	
	$get_info=mysql_query("select * from os_branch where id=$id");
	
	if(mysql_num_rows($get_info)==0)
	{
		echo "No record found!!";
	}
	else
	{
		

	$a=mysql_fetch_array($get_info,MYSQL_ASSOC);
	if($a["pic"]=="")
	{
		$pic="empty";
		$piclink="noimage.jpg";
		$fix="";
	}
	else
	{
		$piclink="branch_".$a['id'].".gif";
		if($a["width"]>300 or $a["height"]>250)
		{
			if($a["width"]-$a["height"]>0)
			{
				$fix="width=300";
				
			}
			else
			{
				$fix="height=250";
				
			}						
		}
		else
		{
			$fix="width=".$a["width"];
			
		}
	}
	
?>
<table width="95%" cellpadding="2" cellspacing="1">

	<td valign="top">
	<table width="584">
	<tr>
		<td colspan="4"><font class="title">Edit branch</font></td>
	</tr>
	<script type="text/javascript" src="required/js/calendarDateInput.js"></script>	
	<script language="JavaScript" type="text/javascript" src="wysiwyg.js">
				</script>	
	<form action="branch_edit2.php" method="post" name="frm" onSubmit="return frmValidate(this)">
	<input type="hidden" value="<?= $id ?>" name="id">
	<tr>
		<td>branch name</td><td>:</td><td><input class="text" type="text" name="branch_name" size="30" value="<?= $a['branch_name'] ?>" maxlength="200"></td>
	</tr>
	<tr valign="top">
		<td>Address</td><td>:</td><td>
		
		<textarea rows="5" cols="30" class="text" name="address"><?= str_replace("<br>","\n",$a['address']) ?></textarea></td>
	</tr>
	<tr>
		<td>Tel</td><td>:</td><td><input class="text" type="text" name="tel" size="30" value="<?= $a['tel'] ?>" maxlength="20"></td>
	</tr>
	<tr>
		<td>Fax</td><td>:</td><td><input class="text" type="text" name="fax" size="30" value="<?= $a['fax'] ?>" maxlength="20"></td>
	</tr>
	
	
	<tr>
		<td colspan="3" align="center"><br><input type="submit" value="Update" class="button">  <input type="button" value="Back" class="button" onclick="window.open('branch.php','_self')"><br><br></td>
	</tr>
	</form>
	</table></td>
			
</table>
<? } require("required/footer.php"); ?>

